package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.internetofthings.firefightingiot;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class FireDeviceService extends BaseService {

	private static final Logger logger = LoggerFactory.getLogger(FireDeviceService.class);

	/**
	 * 设备添加
	 * @param
	 * @return
	 */
	public RespEntity add(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

		return fireFightingiotJava(jsonParam,"add","device");
	}

	/**
	 * 设备删除
	 * @param
	 * @return
	 */
	public RespEntity delete(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

		return fireFightingiotJava(jsonParam,"delete","device");
	}

	/**
	 * 设备修改
	 * @param
	 * @return
	 */
	public RespEntity update(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());

		return fireFightingiotJava(jsonParam,"update","device");
	}

	/**
	 * 设备列表
	 * @param
	 * @return
	 */
	public RespEntity deviceListPage(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceListPage","device");
	}

	/**
	 * 设备详情
	 * @param
	 * @return
	 */
	public RespEntity detail(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"detail","device");
	}

	/**
	 * 设备正常数据查询
	 * @param
	 * @return
	 */
	public RespEntity normalDataLogList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"normalDataLogList","device");
	}

	/**
	 * 电气火灾其他参数列表
	 * @param
	 * @return
	 */
	public RespEntity eleNormalOtherList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"eleNormalOtherList","device");
	}

	/**
	 * 产品列表
	 * @param
	 * @return
	 */
	public RespEntity productList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"productList","device");
	}

	/**
	 * 单位摄像头列表
	 * @param
	 * @return
	 */
	public RespEntity deviceCameraList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceCameraList","device");
	}
	/**
	 * 查询单位下的led,ip音柱，鹰眼e通设备列表
	 * @param
	 * @return
	 */
	public RespEntity deviceList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceList","device");
	}

	/**
	 * 卸油证据链分页列表
	 * @param
	 * @return
	 */
	public RespEntity getChainOfEvidencePageList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getChainOfEvidencePageList","device");
	}

	/**
	 * @Author YangYu
	 * @Description 海康梯控远程关门
	 * @Date Created in 14:23 2021/12/8
	 * @Param [jsonParam]
	 */

	public RespEntity remoteClosing(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"remoteClosing","device");
	}
	/**
	 * 查询单位下的led,ip音柱，鹰眼e通设备列表（new）
	 * @param
	 * @return
	 */
	public RespEntity deviceListNew(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceListNew","device");
	}
	/**
	 * 平台列表
	 * @param
	 * @return
	 */
	public RespEntity platformList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiot(jsonParam,"platformList","device");
	}

	/**
	 * 功能列表
	 * @param
	 * @return
	 */
	public RespEntity functionList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiot(jsonParam,"functionList","device");
	}

	/**
	 * 今日每个时刻的报警数目统计
	 * @param
	 * @return
	 */
	public RespEntity todayNormalDataLogNumByMin(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"todayLogNum","device");
	}

	/**
	 * 设备类型列表
	 * @param
	 * @return
	 */
	public RespEntity deviceTypeList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceTypeList","device");
	}

	/**
	 * 设备正常数据保存
	 * @param
	 * @return
	 */
	public RespEntity normalDataLogAdd(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"normalDataLogAdd","device");
	}

	/**
	 *设备操作分类功能：添加
	 * @param
	 * @return
	 */
	public RespEntity typeAdd(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"typeAdd","device");
	}

	/**
	 *设备操作分类功能：添加
	 * @param
	 * @return
	 */
	public RespEntity typeUpdate(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"typeUpdate","device");
	}

	/**
	 *设备操作分类功能：添加
	 * @param
	 * @return
	 */
	public RespEntity typeDelete(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"typeDelete","device");
	}

	/**
	 * 设备绑定openid
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceWechat(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceWechat","device");
	}

	/**
	 * 查询Rtmp视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getRtmp(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getRtmp","device");
	}
	/**
	 * 查询海康Rtsp视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getHKRtsp(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getHKRtsp","device");
	}
	/**
	 * 查询海康Rtmp视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getHKRtmp(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getHKRtmp","device");
	}
	/**
	 * 查询Rtsp语音流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getTalkRtsp(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getHKTalkRtsp","device");
	}
	/**
	 * 拉取直播视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getLiveStream(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getLiveStream","device");
	}
	/**
	 * 拉取回放视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getPlaybackStream(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getPlaybackStream","device");
	}
	/**
	 * 远程控制分闸状态
	 * @param jsonParam
	 * @return
	 */
	public RespEntity openIssued(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"openIssued","device");
	}
	/**
	 * 根据单位获取明厨亮灶设备
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getBrightKitchenDevice(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getBrightKitchenDevice","device");
	}
	/**
	 * 根据机构获取明厨亮灶设备
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getOrgBrightKitchenDevice(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getOrgBrightKitchenDevice","device");
	}
	/**
	 * 加油站设备通道新增、编辑
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceChannelAddOrUpdate(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceChannelAddOrUpdate","device");
	}
	/**
	 * 加油站设备通道列表
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceChannelList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceChannelList","device");
	}
	/**
	 * 加油站设备通道删除
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceChannelDel(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceChannelDel","device");
	}
	/**
	 * 设备与监控新增、编辑绑定
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceCameraBindingAddOrUpdate(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceCameraBindingAddOrUpdate","device");
	}
	/**
	 * 删除
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceCameraBindingDel(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceCameraBindingDel","device");
	}
	/**
	 * 设备与监控绑定列表
	 * @param jsonParam
	 * @return
	 */
	public RespEntity deviceCameraBindingList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"deviceCameraBindingList","device");
	}

	/**
	 * 电信AEP盛善电设备下发指令
	 * @param jsonParam
	 * @return
	 */
	public RespEntity createCommand(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"createCommand","device");
	}
	/**
	 * 电能数据(单个设备查询)
	 * @param
	 * @return
	 */
	public RespEntity electricEnergyList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"electricEnergyList","device");
	}

	/**
	 * 电正常数据详情
	 * @param
	 * @return
	 */
	public RespEntity getElectricDataDetails(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getElectricDataDetails","device");
	}

	/**
	 * 获取视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getVideoStream(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getVideoStream","device");
	}
	/**
	 * 关闭视频流
	 * @param jsonParam
	 * @return
	 */
	public RespEntity closeVideoStream(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"closeVideoStream","device");
	}
	/**
	 * 小程序、APP设备统计模块
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getDeviceCountApp(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getDeviceCountApp","device");
	}

	/**
	 * 获取水柱箱体数据
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getWaterColumnBoxData(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getWaterColumnBoxData","device");
	}

	/**
	 * 水柱箱体下发指令
	 * @param jsonParam
	 * @return
	 */
	public RespEntity setWaterColumnBoxData(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"setWaterColumnBoxData","device");
	}
	/**
	 * 获取水柱箱体历史数据
	 * @param jsonParam
	 * @return
	 */
	public RespEntity waterColumnBoxDataLogList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"waterColumnBoxDataLogList","device");
	}
	/**
	 * sos通讯录新增、编辑
	 * @param jsonParam
	 * @return
	 */
	public RespEntity addOrUpdateBook(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"addOrUpdateBook","device");
	}
	/**
	 * sos通讯录列表
	 * @param jsonParam
	 * @return
	 */
	public RespEntity sosAddressBookList(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"sosAddressBookList","device");
	}

	/**
	 * 设置视频设备播放时间
	 * @param jsonParam
	 * @return
	 */
	public RespEntity setVideoPlayTime(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"setVideoPlayTime","device");
	}

	/**
	 * 获取视频设备播放时间
	 * @param jsonParam
	 * @return
	 */
	public RespEntity getVideoPlayTime(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getVideoPlayTime","device");
	}

	/**
	 * 更新视频设备播放时间
	 * @param jsonParam
	 * @return
	 */
	public RespEntity updateVideoPlayTime(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"updateVideoPlayTime","device");
	}


	/**
	 * @Author YangYu
	 * @Description 手动更新设备状态
	 * @Date Created in 13:45 2024/1/10
	 * @Param [jsonParam]
	 */

	public RespEntity updateDeviceState(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"updateDeviceState","device");
	}

	/**
	 * @Author YangYu
	 * @Description 获取气体灭火系统数据
	 * @Date Created in 13:45 2024/1/10
	 * @Param [jsonParam]
	 */

	public RespEntity getGasFireExtinguishingData(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"getGasFireExtinguishingData","device");
	}

	/**
	 * @Author YangYu
	 * @Description 物联网平台远程下发指令
	 * @Date Created in 16:55 2024/12/17
	 * @Param [jsonParam]
	 */

	public RespEntity iotPost(JSONObject jsonParam) {
		jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
		return fireFightingiotJava(jsonParam,"iotPost","device");
	}
}
